package com.worldtolearn.user.bu;

import java.io.Serializable;

import javax.inject.Inject;
import javax.inject.Named;

import com.worldtolearn.logging.SingletonLogger;
import com.worldtolearn.user.dao.AccountDAO;
import com.worldtolearn.user.entity.Account;

@Named
public class AccountBuImpl implements IAccountBu, Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Inject
	AccountDAO accountDao;
	
	
	public AccountDAO getAccountDao() {
		return accountDao;
	}
	public void setAccountDao(AccountDAO accountDao) {
		this.accountDao = accountDao;
	}

	
	@Override
	public void create(Account account) {
		accountDao.create(account);
		SingletonLogger.monLogger.info("The account has been successfully created!");
	}

	@Override
	public Account read(int id) {
		// TODO A VERIFIER TEST
		return accountDao.read(id);
	}

	@Override
	public void update(Account account) {
		accountDao.update(account);
		SingletonLogger.monLogger.info("The account has been successfully created!");
	}

	@Override
	public void delete(Account account) {
		accountDao.delete(account);
		SingletonLogger.monLogger.info("The account has been successfully created!");
	}

}
